<template>
	<view class=bothang>
		<view class="botlist">
			<view class="newbotview" v-for="(item,index) in footlist" :key="index" @click.stop="oneClick(item,index)">
				<view class="botitem">
					<text class="bleft">{{item.title}}</text>
					<image src="/static/home/xia.png" class="xia" v-if="!item.iszhan"></image>
					<image src="/static/home/shang.png" class="xia" v-if="item.iszhan"></image>
				</view>
				<view class="botzhan" v-if="item.iszhan">
					<view class="zhanitem" v-for="(i,ind) in item.list" :key="ind" @click.stop="twoClick(i,ind,index)">{{i.name}}</view>
				</view>
			</view>
			
			<!-- <view class="botitem">
				<text class="bleft">快捷入口</text>
				<image src="/static/home/xia.png" class="xia"></image>
			</view>
			<view class="botitem">
				<text class="bleft">快捷入口</text>
				<image src="/static/home/xia.png" class="xia"></image>
			</view> -->
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			backgroundColor:{
				type: String,
				default:'#fff'
			},
		},
		data() {
			return {
				botdata:[
					{
						name:'快捷入口',
						iszhan:false,
						nav:[
							{name:'融跃网校',path:''},
							{name:'融跃APP',path:''},
							{name:'融跃题库',path:''},
							{name:'融跃商城',path:''}
						],
						path:''
					},
					{name:'关于融跃',iszhan:false,nav:[{name:'融跃网校',path:''},{name:'融跃APP',path:''},{name:'融跃题库',path:''},{name:'融跃商城',path:''}],path:''},
					{name:'融跃产品',iszhan:false,nav:[{name:'融跃网校',path:''},{name:'融跃APP',path:''},{name:'融跃题库',path:''},{name:'融跃商城',path:''}],path:''},
					{name:'融跃服务',iszhan:false,nav:[{name:'融跃网校',path:''},{name:'融跃APP',path:''},{name:'融跃题库',path:''},{name:'融跃商城',path:''}],path:''},
					{name:'联系我们',iszhan:false,nav:[{name:'融跃网校',path:''},{name:'融跃APP',path:''},{name:'融跃题库',path:''},{name:'融跃商城',path:''}],path:''}
				],
				footlist:[]
			}
		},	
		mounted() {
			// console.log(this.botdata)
		},
		created() {
			this.fgetMenuFoot();//底部
		},
		methods: {
			oneClick(item,index){
				// let botdata = this.botdata
				// botdata[index].iszhan = !botdata[index].iszhan
				let footlist = this.footlist
				footlist[index].iszhan = !footlist[index].iszhan
				this.footlist = footlist
			},
			twoClick(i,ind,index){
				let footlist = this.footlist
				// console.log(footlist[index].list[ind].name)
				this.toPage(footlist[index].list[ind])
			},
			async fgetMenuFoot(){
				let res = await this.$u.api.getMenuFoot({
				});
				let data = res
				for(let i in data){
					data[i].iszhan = false
				}
				this.footlist = data
			}
		}
	}
</script>

<style scoped lang="scss">
	.bothang{
		background: #252525;
		.botlist{
			display: flex;
			flex-direction: column;
			.botitem{
				padding: 35rpx 30rpx;
				border-bottom: 1rpx solid  #4A4A4A;
				display: flex;
				flex-direction: row;
				align-items: center;
				.bleft{
					font-family: PingFang SC;
					font-weight: 500;
					font-size: 28rpx;
					color: #FFFFFF;
				}
				.xia{
					margin-left: auto;
					width: 20rpx;
					height: 10rpx;
				}
			}
			.botzhan{
				padding: 0 56rpx;
				.zhanitem{
					padding: 30rpx 0;
					display: flex;
					flex-direction: row;
					font-family: PingFang SC;
					font-weight: 500;
					font-size: 24rpx;
					color: #999999;
				}
			}
		}
	}
</style>
